/**   
 * @Title: SysUserDaoImpl.java 
 * @Package com.leesche.zcsp.node.dao.impl 
 * @Description:() 
 * @author dennies yang
 * @date 2016年9月22日 下午3:30:11 
 * @version V1.0   
 */
package com.leesche.zcsp.node.web.dao.impl;

import java.util.List;

import com.leesche.zcsp.node.web.dao.SysUserDao;
import com.leesche.zcsp.node.web.model.SysUser;
import com.leesche.zcsp.node.web.model.SysUserCriteria;
import com.leesche.zcsp.node.web.service.impl.data.read.QuerySysUserCondition;
import com.leesche.zcsp.node.web.service.impl.data.read.SysUserDto;

/**
 * @Title: SysUserDaoImpl.java
 * @Package com.leesche.zcsp.node.dao.impl
 * @Description:()
 * @author dennies yang
 * @date 2016年9月22日 下午3:30:11
 * @version V1.0
 */
public class SysUserDaoImpl
		extends
		BaseDaoImpl<SysUser, SysUserCriteria, SysUserDto, QuerySysUserCondition, Long>
		implements SysUserDao {

	private static final String DB_SELECTSYSUSERBYUSERNAMEANDPASSWORD = "selectSysUserByUsernameAndPassword";

	public SysUser selectSysUserByUsernameAndPassword1(
			QuerySysUserCondition condition) {
		System.out.println(this.getStatement(DB_SELECTSYSUSERBYUSERNAMEANDPASSWORD));
		return this.getSqlSession().selectOne(this.getStatement(DB_SELECTSYSUSERBYUSERNAMEANDPASSWORD),condition
				);
	}

	@Override
	public SysUser selectSysUserByUsername(SysUser sysUser) {
		// TODO Auto-generated method stub
		return this.getSqlSession().selectOne("selectSysUserByUsername", sysUser);
	}

	@Override
	public int insertBatch(List<SysUser> sysUsers) {
		// TODO Auto-generated method stub return 0;
		return this.getSqlSession().insert("insertBatch", sysUsers);
	}

	@Override
	public int updateUserPasswordByUserID(SysUser sysUser) {
		// TODO Auto-generated method stub return 0;
		return this.getSqlSession().update("updateUserPasswordByUserID", sysUser);
	}

	@Override
	public int updateUserTransferPasswordByUserID(SysUser sysUser) {
		// TODO Auto-generated method stub return 0;
		return this.getSqlSession().update("updateUserTransferPasswordByUserID", sysUser);
	}

	@Override
	public List<SysUser> selectByParentUserID(SysUser sysUser) {
		// TODO Auto-generated method stub return null;
		return this.getSqlSession().selectList("selectByParentUserID", sysUser);
	}

	@Override
	public SysUser selectLastChildUserByParentUserid(Long parentUserID) {
		// TODO Auto-generated method stub return null;
		return this.getSqlSession().selectOne("selectLastChildUserByParentUserid", parentUserID);
	}

	@Override
	public List<SysUserDto> selectChildUserByParentIDAndRoleID(QuerySysUserCondition condition) {
		return this.getSqlSession().selectList("QuerySysUserCondition", condition);
	}

	@Override
	public Integer countUserByCondition(QuerySysUserCondition condition) {
		return null;
	}
}
